package com.ocom.ugcapi.controller;

import com.ocom.common.constant.WxServiceUrl;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.recode.AccessRecordVo;
import com.ocom.common.vo.ugcapi.GzhUserInfo;
import com.ocom.ugcapi.client.MjRecodeClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2023/5/26
 **/
@RestController
public class MjRecodeController {

	@Autowired
	MjRecodeClientService mjRecodeClientService;


	@PostMapping(WxServiceUrl.URL_mjrecode)
	public Result mjrecode(@RequestBody Map<String, Object> map) {
		GzhUserInfo userInfo  = (GzhUserInfo)map.get("userInfo");

		AccessRecordVo accessRecordVo = new AccessRecordVo();
		accessRecordVo.setComId(userInfo.getComId().intValue());
		accessRecordVo.setPId(userInfo.getPId().intValue());
		accessRecordVo.setBeginTime((String) map.get("beginTime"));
		accessRecordVo.setEndTime((String) map.get("endTime"));
		accessRecordVo.setPage((Integer) map.get("page"));
		accessRecordVo.setSize((Integer) map.get("size"));

		return mjRecodeClientService.GetAccessRecord(accessRecordVo);
	}





}
